﻿@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Defaults.cshtml";
}

<div ng-app="app" ng-controller="DemoCtrl">                     
   
     <div class="row-fluid">
         <div class="span6">
          <div class="control-group">
                                  <label class="control-label" for="selectError">Loại báo cáo</label>
                                  <div class="controls">
                                        <select   ng-model="item.id" ng-change="selectCombobox(item.id)"   >
                                            <option ng-repeat="item in reports" value="{{item.id}}">{{item.name}}</option>
                                        </select>
                                  </div>
               </div> 
        </div>
         <div class="span6">
          <div class="control-group" id="exportid">
                                  <label class="control-label" for="selectError">Export</label>
                                  <div class="controls">
                                        <select   ng-model="item1.id" ng-change="selectComboboxExport(item1.id)"   >
                                            <option ng-repeat="item1 in exports" value="{{item1.id}}">{{item1.name}}</option>
                                        </select>
                                  </div>
               </div>      
        </div>
         <div class="span6">
            
             <div class="control-group" id="bctd">
                                  <label class="control-label" for="selectError">Trình Độ</label>
                                  <div class="controls">
                                        <select   ng-model="td.iD" ng-change="selectComboboxTD(td.iD)"   >
                                            <option ng-repeat="td in trinhdos" value="{{td.iD}}">{{td.tENTD}}</option>
                                        </select>
                                  </div>
               </div>
         </div>
           <div class="span6">
            
             <div class="control-group" id="bcvu">
                                  <label class="control-label" for="selectError">Vụ</label>
                                  <div class="controls">
                                        <select  id="type_id" ng-model="vu.iD" ng-change="selectComboboxVu(vu.iD)"   >
                                            <option ng-repeat="vu in vus" value="{{vu.iD}}">{{vu.tENVU}}</option>
                                        </select>
                                  </div>
               </div>
         </div>

     </div>

    <table class="table table-striped table-bordered bootstrap-datatable datatable">
            <tr>
                <th>
                    <a href="#" ng-click="orderByField='iD'; reverseSort = !reverseSort">
                       Mã nhân viên <span ng-show="orderByField == 'iD'"><span ng-show="!reverseSort">^</span><span ng-show="reverseSort">v</span></span>
                    </a>
                </th>
                <th>
                     <a href="#" ng-click="orderByField='hONV'; reverseSort = !reverseSort">
                        Họ và tên đệm <span ng-show="orderByField == 'hONV'"><span ng-show="!reverseSort">^</span><span ng-show="reverseSort">v</span></span>
                    </a>
                </th>
                <th>
                     <a href="#" ng-click="orderByField='tENNV'; reverseSort = !reverseSort">
                        Tên <span ng-show="orderByField == 'tENNV'"><span ng-show="!reverseSort">^</span><span ng-show="reverseSort">v</span></span>
                    </a>
                </th>
                <th>
                     <a href="#" ng-click="orderByField='nGAYSINH'; reverseSort = !reverseSort">
                       Ngày sinh <span ng-show="orderByField == 'nGAYSINH'"><span ng-show="!reverseSort">^</span><span ng-show="reverseSort">v</span></span>
                    </a>
                </th>
                <th>
                    <a href="#" ng-click="orderByField='nGAYSINH'; reverseSort = !reverseSort">
                       Địa chỉ <span ng-show="orderByField == 'nGAYSINH'"><span ng-show="!reverseSort">^</span><span ng-show="reverseSort">v</span></span>
                    </a>
                </th>    
                <th></th>
            </tr>
            <tr ng-repeat="nv in nhanviens |orderBy:orderByField:reverseSort  | filter:search">
                <td> {{nv.iD}}</td>
                <td> {{nv.hONV | uppercase}}</td>
                <td> {{nv.tENNV | uppercase}}</td>
                <td> {{nv.nGAYSINH | date :'dd-MM-yyyy'}}</td>
                <td> {{nv.dIACHI}}</td>      
                <td class="center">
                    <a class="btn btn-success" ng-click="detail(nv)">
										<i class="icon-zoom-in icon-white"></i>  
										Thông tin                                            
                    </a>
                    
                     <div ng-show="showEdit()">
                                <a class="btn btn-info" ng-click="appDialog(true,nv)">
										<i class="icon-edit icon-white"></i>  
										Sửa                                            
									</a>
                            </div>
                                <div ng-show="showDelete()">
									<a class="btn btn-danger" ng-click="delete(nv.iD)">
										<i class="icon-trash icon-white"></i> 
										Xóa
									</a>
                             </div>

                </td>               
            </tr>
     </table>

        <div ng-controller="DialogCtrl">
            <jqdialog dialog-name="App" title="'Đạo pháp'"
                      auto-open="false" width="850" height="450"
                      on-open="onOpen" buttons="{'Lưu': onOk, 'Hủy': onCancel, 'Đóng': 'close' }"
                      args-to-scope="true"
                      before-close="beforeClose">                
                <form class="form-horizontal">
                    <fieldset>
                        <div class="control-group">
							  <label class="control-label" for="user_name">Tài Khoản : </label>
							  <div class="controls">
								<input id="user_name" ng-model="obj.user_name"/>				
							  </div>
						</div>
                        
                        <div class="control-group">
							  <label class="control-label" for="pass_word">Mật Khẩu : </label>
							  <div class="controls">
								<input id="pass_word" ng-model="obj.pass_word"/>				
							  </div>
						</div>
                        <div class="control-group">
							  <label class="control-label" for="email">Email : </label>
							  <div class="controls">
								<input id="email" ng-model="obj.email"/>				
							  </div>
						</div>

                        <div class="control-group">
							  <label class="control-label" for="phone">Điện thoại : </label>
							  <div class="controls">
								<input id="phone" ng-model="obj.phone"/>				
							  </div>
						</div>
                          <div class="control-group">
                                  <label class="control-label" for="selectError">Nhóm</label>
                                  <div class="controls">
                                        <select ng-model="obj.type_id" id="type_id" >
                                            <option ng-repeat="item in gusers" value="{{item.id}}">{{item.group_name}}</option>
                                        </select>
                                  </div>
                          </div>
                    </fieldset>
                </form>                
            </jqdialog>
        </div>
 </div>

<script src="~/Content/lib/jquery-1.8.3.js"></script> 
<script src="~/Content/lib/jquery-ui.js"></script>
<script src="~/Content/lib/angular.js"></script>
<script src="~/Content/lib/module.js"></script>
<script src="~/Content/js/jqdialog/jqdialog.js"></script>
<script src="~/Content/md/nv/rport.js"></script>
<script>
    $("#dscv").html("Báo Cáo Nhân Viên");
</script>
